﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects;
using ImageService.DataTransferObjects;

namespace ImageService.DataTransferObjectMapper
{
    public static class Mapper
    {
        public static RestaurantMenuDto ToDataTransferObject(RestaurantMenu restaurantMenu)
        {
            if (restaurantMenu == null) return null;

            return new RestaurantMenuDto
            {
                MenuID = restaurantMenu.MenuID,
                MenuCode = restaurantMenu.MenuCode,
                MenuName = restaurantMenu.MenuName,
                Description = restaurantMenu.Description,
                UnitID = restaurantMenu.UnitID,
                SalesPrice = restaurantMenu.SalesPrice,
                MenuImage = restaurantMenu.MenuImage,
                IsActive = restaurantMenu.IsActive,
                IsNorm = restaurantMenu.IsNorm,
                RestaurantID = restaurantMenu.RestaurantID,
                MenuCategoryID = restaurantMenu.MenuCategoryID
            };
        }

        public static RestaurantMenu FromDataTransferObject(RestaurantMenuDto c)
        {
            return new RestaurantMenu
            {
                MenuID = c.MenuID,
                MenuCode = c.MenuCode,
                MenuName = c.MenuName,
                Description = c.Description,
                UnitID = c.UnitID,
                SalesPrice = c.SalesPrice,
                MenuImage = c.MenuImage,
                IsActive = c.IsActive,
                IsNorm = c.IsNorm,
                RestaurantID = c.RestaurantID,
                MenuCategoryID = c.MenuCategoryID
            };
        }
    }
}
